/*
 * WordRelationship.java
 *
 * Created on 30.9.2007, 17:10:25
 *
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.easyedu.dictionary.api.model;

import eu.easyedu.dictionary.api.util.StringUtils;
import eu.easyedu.persistence.annotations.Column;
import eu.easyedu.persistence.annotations.Entity;

/**
 *
 * @author hlavki
 */
@Entity(table = "WORD_RELATIONSHIP")
public class WordRelationship {

    @Column(name = "WORD_RELATIONSHIP_ID", uniqueName = true)
    private Long id;
    @Column(name = "WORD_ID")
    private Word word;
    @Column(name = "RELATED_WORD_ID")
    private Word relatedWord;
    @Column(name = "RELATIONSHIP")
    private Relationship relationship;


    public WordRelationship() {
    }


    public WordRelationship(Long id, Word word, Word relatedWord, Relationship relationship) {
        this.id = id;
        this.word = word;
        this.relatedWord = relatedWord;
        this.relationship = relationship;
    }


    public WordRelationship(Word word, Word relatedWord, Relationship relationship) {
        this.word = word;
        this.relatedWord = relatedWord;
        this.relationship = relationship;
    }


    public WordRelationship(Word relatedWord, Relationship relationship) {
        this.relatedWord = relatedWord;
        this.relationship = relationship;
    }


    public Long getId() {
        return id;
    }


    public void setId(Long id) {
        this.id = id;
    }


    public Relationship getRelationship() {
        return relationship;
    }


    public void setRelationship(Relationship relationship) {
        this.relationship = relationship;
    }


    public Word getRelatedWord() {
        return relatedWord;
    }


    public void setRelatedWord(Word relatedWord) {
        this.relatedWord = relatedWord;
    }


    public Word getWord() {
        return word;
    }


    public void setWord(Word word) {
        this.word = word;
    }


    @Override
    public String toString() {
        return StringUtils.toString("r", this);
    }
}
